package com.md.drcs.dicom.dao;

import com.md.common.utils.dao.MyMapper;
import com.md.drcs.dicom.dto.ImagePathDTO;
import com.md.drcs.dicom.entity.SeriesEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SeriesDao extends MyMapper<SeriesEntity> {

    @Select("select * from t_series where nStuId = #{studyId}")
    List<SeriesEntity> findByStudyId(Long studyId);

    @Select("select" +
            " concat(a.sImagePath,'\\\\',b.sImagePath) as image_path, a.diskCode" +
            " from t_study a,t_series b" +
            " where a.nStuId=b.nStuId" +
            " and a.sHospId= #{hospId}" +
            " and a.sHospStuid= #{hospStuId}" +
            " and b.sSeriesidinpacs= #{seriesIdInPacs}")
    ImagePathDTO findImagePath(@Param("hospId") String hospId, @Param("hospStuId") String hospStuId, @Param("seriesIdInPacs") String seriesIdInPacs);

}
